package com.cc.service.iml;

import com.cc.mapper.UserMapper;
import com.cc.model.EbUser;
import com.cc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<EbUser> list(Integer page, Integer pageSize) {
        return userMapper.findByPage((page-1) * pageSize,pageSize);
    }

    @Override
    public int save(EbUser ebUser) {
        return userMapper.save(ebUser);
    }

    @Override
    public int getMaxPage(int pageSize) {
        return userMapper.getMaxPage(pageSize);
    }


    @Override
    public int deleteByPk(String eoId) {
        return userMapper.delete(eoId);
    }

    @Override
    public EbUser selectByCondition(String eoId) {
        return userMapper.findById(eoId);
    }

    @Override
    public int updateById(EbUser ebUser) {
        return userMapper.updateByPrimaryKey(ebUser);
    }
@Override
    public EbUser checkUser(String userName, String passWord){
        return userMapper.checkUser(userName,passWord);
}
}
